//
//  VideoControl.m
//  iPhoneControlApplication
//
//  Created by Elliot Chapple on 11/04/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "VideoControl.h"


@implementation VideoControl


//Synth the objects up
@synthesize	playbut;
@synthesize	pause;
@synthesize	next;
@synthesize	previous;
@synthesize	menuButton;
@synthesize	titleButton;
@synthesize	ejectButton;
@synthesize upNav;
@synthesize	downNav;
@synthesize	leftNav;
@synthesize	rightNav;
@synthesize	powerButton;
@synthesize	audioButton;
@synthesize	subtitlesButton;
@synthesize	videoInfo;
@synthesize	volumeSlider;
@synthesize selectButton;
@synthesize muteButton;


//Master Methods

-(IBAction)volumeSliderChange:(id)sender
{
	UISlider *slider = (UISlider *)sender;
	int volumeChange = (int)(slider.value);
	
	NSString *newVolume = [[NSString alloc] initWithFormat:@"%d", volumeChange];
	NSString *alertMessage = [[NSString alloc] initWithFormat:@"The new Volume is %@",newVolume];
	
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Volume Altered" message:alertMessage delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
	[alert show];
	[alert release];
	
}


-(IBAction)buttonPress:(id)sender
{
	NSString *title = [sender titleForState:UIControlStateNormal];
	NSString *newText = [[NSString alloc] initWithFormat:@"The %@ button has been selected", title];
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Button Selected" message:newText delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
	[alert show];
	[alert release];
	[newText release];
}

-(IBAction)nowPlayingInformation
{
	
}







//Apple Code
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	//Add user notification to show which area is being controlled
	NSString *newText = [[NSString alloc] initWithFormat:@"This application is now simulating control of Video Devices"];
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Connection Established" message:newText delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
	[alert show];
	[alert release];
	[newText release];
	
	//To override the standard interface builder button so a more pleasing
	//button is displayed ot the users
	
	//This is for the Select Button
	UIImage *buttonImageNormal = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal = [buttonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ selectButton setBackgroundImage:stretchableButtonImageNormal forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed = [buttonImagePressed stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ selectButton setBackgroundImage:stretchableButtonImagePressed forState:UIControlStateHighlighted];
	
	//For the Title Button
	UIImage *buttonImageNormal1 = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal1 = [buttonImageNormal1 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ titleButton setBackgroundImage:stretchableButtonImageNormal1 forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed1 = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed1 = [buttonImagePressed1 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ titleButton setBackgroundImage:stretchableButtonImagePressed1 forState:UIControlStateHighlighted];
	
	
	//For the Menu Button
	UIImage *buttonImageNormal2 = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal2 = [buttonImageNormal2 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ menuButton setBackgroundImage:stretchableButtonImageNormal2 forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed2 = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed2 = [buttonImagePressed2 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ menuButton setBackgroundImage:stretchableButtonImagePressed2 forState:UIControlStateHighlighted];
	
	
	//For the Audio Selection Button
	UIImage *buttonImageNormal3 = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal3 = [buttonImageNormal3 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ audioButton setBackgroundImage:stretchableButtonImageNormal3 forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed3 = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed3 = [buttonImagePressed3 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ audioButton setBackgroundImage:stretchableButtonImagePressed3 forState:UIControlStateHighlighted];
	
	//For the subtitles button
	UIImage *buttonImageNormal4 = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal4 = [buttonImageNormal4 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ subtitlesButton setBackgroundImage:stretchableButtonImageNormal4 forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed4 = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed4 = [buttonImagePressed4 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ subtitlesButton setBackgroundImage:stretchableButtonImagePressed4 forState:UIControlStateHighlighted];
	
	//For the Eject button
	UIImage *buttonImageNormal5 = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal5 = [buttonImageNormal5 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ ejectButton setBackgroundImage:stretchableButtonImageNormal5 forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed5 = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed5 = [buttonImagePressed5 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ ejectButton setBackgroundImage:stretchableButtonImagePressed5 forState:UIControlStateHighlighted];
	
	//For the Mute button
	UIImage *buttonImageNormal6 = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal6 = [buttonImageNormal6 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ muteButton setBackgroundImage:stretchableButtonImageNormal6 forState:UIControlStateNormal];
	
	UIImage *buttonImagePressed6 = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed6 = [buttonImagePressed6 stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	[/*Put button name here*/ muteButton setBackgroundImage:stretchableButtonImagePressed6 forState:UIControlStateHighlighted];
	
	
}

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
    [super dealloc];
}


@end
